package cn.tansanqinger.controller.account;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import cn.tansanqinger.service.account.IUserService;
import cn.tansanqinger.service.hymenu.IHyMenuServer;
import cn.tansanqinger.util.PageData;

@Controller
@RequestMapping("/account/user")
public class AccountIndexController {

	@Autowired
	private IHyMenuServer hyMenuServer;
	@Autowired
	private IUserService uservice;
	
	@RequestMapping("/index")
	public ModelAndView list(ModelAndView mv, HttpServletRequest request) {
		mv = hyMenuServer.selectHyMenuAll(mv);
		mv.addObject("user", request.getSession().getAttribute("user"));
		mv.setViewName("account/index");
		return mv;
	}
	
	@RequestMapping("/subOfPersInformation")
	@ResponseBody
	public PageData SubOfPersInformation(HttpServletRequest request) {
		return uservice.modification(request);
	}
}
